package com.bankcomm.peripheral;

import android.graphics.Bitmap;
import android.os.Parcel;
import android.os.Parcelable;

import java.util.Arrays;

/**
 * 保存身份信息的Bean
 * 
 */
public class IdentityInfoBean implements Parcelable {
	/**
	 * 姓名
	 */
	public String fullName;
	/**
	 * 性别 1 男 0 女
	 */
	public String gender;
	/**
	 * 证件照片
	 */
	public Bitmap photo;
	/**
	 * 证件照片 路径
	 */

	public String filePath;

	public String photoLocal;

	/**
	 * 证件照片字符串
	 */
	public String photoStr;
	/**
	 * 民族
	 */
	public String nation;

	/**
	 * 生日
	 */
	public String birthday;

	/**
	 * 证件上的地址
	 */
	public String address;

	/**
	 * 附加地址
	 */
	public String additionaAddress;

	/**
	 * 证件号码
	 */
	public String identityCardNumber;

	/**
	 * 发证机关
	 */
	public String organization;

	/**
	 * 证件有效期 开始 时间格式 yyyyMMdd
	 */
	public String effectiveDate;

	/**
	 * 证件有效期 结束
	 */
	public String expDate;

	public byte[] fingerData = new byte[0];
	/**
	 * 英文姓名（对应客户英文姓名）
	 */
	public String fEngName;
	/**
	 * 性别（对应性别）
	 */
	public String fGender;
	/**
	 * 永久居留证号码（对应证件号码）
	 */
	public String fIdentityCardNumber;
	/**
	 * 所在地区代码（对应国籍代码）（符合GB/T 2659-2000的规定）
	 */
	public String fNationCode;
	/**
	 * 国籍（中文字符，对应国籍）（符合GB/T 2659-2000的规定）
	 */
	public String fNation;
	/**
	 * 中文姓名（对应客户姓名）
	 */
	public String fFullName;
	/**
	 * 证件签发日期（对应证件签发日期）
	 */
	public String fEffectiveDate;
	/**
	 * 证件终止日期（对应证件有效日期）
	 */
	public String fExpDate;
	/**
	 * 出生日期
	 */
	public String fBirthday;
	/**
	 * 证件版本号
	 */
	public String fCardVersion;
	/**
	 * 当初申请受理机关代码
	 */
	public String fOrganization;
	/**
	 * 证件类型标识（外国人证时，机具返回的标识是“I”）是二代证时，返回0；外国人居留证时，返回1
	 */
	public String fCardTag;
	/**
	 * 预留项
	 */
	public String fAddition;

	/**
	 * 二代证反面
	 */
	public String back;
	/**
	 * 二代证正面
	 */
	public String front;
	/**
	 * 二代证头像
	 */
	public String head;
	/**
	 * 姓名
	 */
	public String gFullName;
	/**
	 * 性别
	 */
	public String gGender;
	/**
	 * 公民身份号码
	 */
	public String gIdentityCardNumber;
	/**
	 * 出生日期
	 */
	public String gBirthday;
	/**
	 * 地址
	 */
	public String gAddress;
	/**
	 * 有效期起始日期
	 */
	public String gEffectiveDate;
	/**
	 * 有效期截止日期
	 */
	public String gExpDate;
	/**
	 * 签发机关
	 */
	public String gOrganization;
	/**
	 * 通行证号码
	 */
	public String gPassNumber;
	/**
	 * 签发次数
	 */
	public String gSignCount;
	/**
	 * 证件类型标识（港澳台居住证时，机具返回的标识是“J”）
	 *是二代证时，返回0；外国人居留证时，返回1；港澳台居住证时，返回2
	 */
	public String gCardTag;
	/**
	 * 预留区A
	 */
	public String gReserveA;
	/**
	 * 预留区B
	 */
	public String gReserveB;
	/**
	 * 预留区C
	 */
	public String gReserveC;

	public String getBack() {
		return back;
	}

	public void setBack(String back) {
		this.back = back;
	}

	public String getFront() {
		return front;
	}

	public void setFront(String front) {
		this.front = front;
	}

	public String getHead() {
		return head;
	}

	public void setHead(String head) {
		this.head = head;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	public IdentityInfoBean() {
	}

	public IdentityInfoBean(Parcel source) {
		source.readString();
		source.readString();
		source.readParcelable(getClass().getClassLoader());
		source.readString();
		source.readString();
		source.readString();
		source.readString();
		source.readString();
		source.readString();
		source.readString();
		source.readString();
		source.readByteArray(fingerData);
		source.readString();
		source.readString();
		source.readString();
		source.readString();
		source.readString();
		source.readString();
		source.readString();
		source.readString();
		source.readString();
		source.readString();
		source.readString();
		source.readString();
		source.readString();

	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(fullName);
		dest.writeString(gender);
		dest.writeParcelable(photo, flags);
		dest.writeString(filePath);
		dest.writeString(nation);
		dest.writeString(birthday);
		dest.writeString(address);
		dest.writeString(additionaAddress);
		dest.writeString(identityCardNumber);
		dest.writeString(organization);
		dest.writeString(effectiveDate);
		dest.writeString(expDate);
		dest.writeByteArray(fingerData);
		dest.writeString(fEngName);
		dest.writeString(fGender);
		dest.writeString(fIdentityCardNumber);
		dest.writeString(fNationCode);
		dest.writeString(fNation);
		dest.writeString(fFullName);
		dest.writeString(fEffectiveDate);
		dest.writeString(fExpDate);
		dest.writeString(fBirthday);
		dest.writeString(fCardVersion);
		dest.writeString(fOrganization);
		dest.writeString(fCardTag);
		dest.writeString(fAddition);
		dest.writeString(gFullName);
		dest.writeString(gGender);
		dest.writeString(gIdentityCardNumber);
		dest.writeString(gBirthday);
		dest.writeString(gAddress);
		dest.writeString(gEffectiveDate);
		dest.writeString(gExpDate);
		dest.writeString(gOrganization);
		dest.writeString(gPassNumber);
		dest.writeString(gSignCount);
		dest.writeString(gCardTag);
		dest.writeString(gReserveA);
		dest.writeString(gReserveB);
		dest.writeString(gReserveC);
	}

	public static final Creator<IdentityInfoBean> CREATOR = new Creator<IdentityInfoBean>() {
		public IdentityInfoBean createFromParcel(Parcel source) {
			return new IdentityInfoBean(source);
		}

		public IdentityInfoBean[] newArray(int size) {
			return new IdentityInfoBean[size];
		}
	};

	@Override
	public String toString() {
		return "IdentityInfoBean{" +
				"fullName='" + fullName + '\'' +
				", gender='" + gender + '\'' +
				", photo=" + photo +
				", filePath='" + filePath + '\'' +
				", photoLocal='" + photoLocal + '\'' +
				", photoStr='" + photoStr + '\'' +
				", nation='" + nation + '\'' +
				", birthday='" + birthday + '\'' +
				", address='" + address + '\'' +
				", additionaAddress='" + additionaAddress + '\'' +
				", identityCardNumber='" + identityCardNumber + '\'' +
				", organization='" + organization + '\'' +
				", effectiveDate='" + effectiveDate + '\'' +
				", expDate='" + expDate + '\'' +
				", fingerData=" + Arrays.toString(fingerData) +
				", fEngName='" + fEngName + '\'' +
				", fGender='" + fGender + '\'' +
				", fIdentityCardNumber='" + fIdentityCardNumber + '\'' +
				", fNationCode='" + fNationCode + '\'' +
				", fNation='" + fNation + '\'' +
				", fFullName='" + fFullName + '\'' +
				", fEffectiveDate='" + fEffectiveDate + '\'' +
				", fExpDate='" + fExpDate + '\'' +
				", fBirthday='" + fBirthday + '\'' +
				", fCardVersion='" + fCardVersion + '\'' +
				", fOrganization='" + fOrganization + '\'' +
				", fCardTag='" + fCardTag + '\'' +
				", fAddition='" + fAddition + '\'' +
				", back='" + back + '\'' +
				", front='" + front + '\'' +
				", head='" + head + '\'' +
				", gFullName='" + gFullName + '\'' +
				", gGender='" + gGender + '\'' +
				", gIdentityCardNumber='" + gIdentityCardNumber + '\'' +
				", gBirthday='" + gBirthday + '\'' +
				", gAddress='" + gAddress + '\'' +
				", gEffectiveDate='" + gEffectiveDate + '\'' +
				", gExpDate='" + gExpDate + '\'' +
				", gOrganization='" + gOrganization + '\'' +
				", gPassNumber='" + gPassNumber + '\'' +
				", gSignCount='" + gSignCount + '\'' +
				", gCardTag='" + gCardTag + '\'' +
				", gReserveA='" + gReserveA + '\'' +
				", gReserveB='" + gReserveB + '\'' +
				", gReserveC='" + gReserveC + '\'' +
				'}';
	}
}
